#ifndef GRADIENTCHOOSER_H
#define GRADIENTCHOOSER_H

#include <gtkmm.h>
#include <list>
#include "colour.h"
#include "display.h"

class GradientChooser : public Gtk::Dialog {
	public:
		GradientChooser(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& refGlade);
		void setColours(std::list<Colour>* colours);
		void setDisplay(Display* display);
	protected:
		Gtk::Button* button_insertbefore_;
		Gtk::Button* button_edit_;
		Gtk::Button* button_insertafter_;
		Gtk::Button* button_remove_;
		Gtk::TreeView* treeview_;
		class Columns : public Gtk::TreeModel::ColumnRecord {
			public:
				Columns() {
					add(iter_);
					add(red_);
					add(green_);
					add(blue_);
				}
				Gtk::TreeModelColumn<std::list<Colour>::iterator> iter_;
				Gtk::TreeModelColumn<uint8_t> red_;
				Gtk::TreeModelColumn<uint8_t> green_;
				Gtk::TreeModelColumn<uint8_t> blue_;
		} columns_;
		Glib::RefPtr<Gtk::ListStore> liststore_;
		std::list<Colour>* colours_;
		Display* display_;
		void on_button_insertbefore_clicked();
		void on_button_edit_clicked();
		void on_button_insertafter_clicked();
		void on_button_remove_clicked();
};

#endif
